package indigo.control
{
	import indigo.utils.DisposableEventDispatcher;

	import flash.events.Event;

	/**
	 * @author Patrick
	 */
	final public class NotificationCenter extends DisposableEventDispatcher
	{
		/**
		 * Reference to the ModelLocator
		 */
		private static var INSTANCE:NotificationCenter = null;


		/**
		 * Constructor
		 * 
		 */
		public function NotificationCenter( singleton:SingletonEnforcer )
		{
			log( "Instantiating" );
			super();
		}


		/**
		 * Returns the instance of the ModelLocator. When there is no reference it
		 * will create a new instance.
		 * @return	Instance of the ModelLocator
		 * 
		 */
		public static function getInstance():NotificationCenter
		{
			if ( INSTANCE == null )
				INSTANCE = new NotificationCenter( new SingletonEnforcer );

			return INSTANCE;
		}


		/**
		 * @inheritDoc
		 * 
		 */
		override public function dispose( event:Event = null ):void
		{
			super.dispose();
			INSTANCE = null;
		}
	}
}
internal class SingletonEnforcer
{
}